<template>
	<van-popup :show="value" :close-on-click-overlay='false'>
		<view class="PopupBox">
			<view class="PopupTitle">
				{{title}}
			</view>
			<view class="PopupContent">
				{{content}}
			</view>
			<view class="PopupBtnBox">
				<view class="" @click="change()" :style="{color:color}" v-if="showdisagreeBtn">
					{{disagreeBtn}}
				</view>
				<view class="PopupBtn" @click="agree()" :style="{width:showdisagreeBtn? '50%' : '100%'}">
					{{agreeBtn}}
				</view>
			</view>
		</view>
	</van-popup>
</template>

<script>
	export default {
		props: {
			value:{
				type:Boolean,
				default:false
			},
			title: {
				type: String,
				default: ''
			},
			content: {
				type: String,
				default: ''
			},
			agreeBtn: {
				type: String,
				default: '确定'
			},
			disagreeBtn: {
				type: String,
				default: '取消'
			},
			color: {
				type: String,
				default: '#000'
			},
			showdisagreeBtn:{
				type: Boolean,
				default:true
			}
		},
		methods: {
			change() {
				this.$emit('change',false)
			},
			agree(){
				this.$emit('change',false)
				this.$emit('agree')
			}
		},
	}
</script>

<style lang="scss">
	.PopupBox {
		text-align: center;
		background: #FFF;
		width: 600rpx;
		border-radius: 30rpx;
		box-sizing: border-box;
		padding: 40rpx 30rpx 30rpx;

		.PopupTitle {
			font-weight: bold;
			font-size: 32rpx;
			padding: 10rpx 0 20rpx;
		}

		.PopupContent {
			color: #333;
			font-size: 26rpx;
			margin-bottom: 50rpx;
		}

		.PopupBtnBox {
			display: flex;
			justify-content: space-between;

			>view {
				width: 50%;
				text-align: center;
			}
		}

		.PopupBtn {
			font-size: 32rpx;
			color: #1A4FBF;
		}
	}
</style>